package base2dev.web.pages.to_delete.data;

import musics.model.Artist;

import org.apache.wicket.markup.html.form.Form;
import org.apache.wicket.spring.injection.annot.SpringBean;

import base2dev.core.common.data.DataFactory;
import base2dev.core.model.Bag;
import base2dev.web.common.BaseWebPage;


public class CreateDefaultData extends BaseWebPage{

	
	@SpringBean 
	private DataFactory dataFactory;

	

	public CreateDefaultData() {
		this("default Data");
	}

	public CreateDefaultData(String title) {
		super(title);
	}

	@Override
	public void setControls() {
		
		Form<String> form = new Form<String>("form") {

			@Override
			protected void onSubmit() {
				super.onSubmit();

				insertDafaultData();
			}

			private void insertDafaultData() {
				dataFactory.InsertDefaultData();
			}
		};

		add(form);
	}

 

	public void setDataFactory(DataFactory dataFactory) {
		this.dataFactory = dataFactory;
	}

	public DataFactory getDataFactory() {
		return dataFactory;
	}
}
